#ifndef _CE_FILE_H_
#define _CE_FILE_H_

#include "cocos2d.h"
#include "../CEGlobalDef.h"

//---------------------------------------------------------------------------
#define SEEK_ERROR		0xFFFFFFFF
//---------------------------------------------------------------------------

class CEFile
{
private:
	FILE *			m_hFile;	// File Handle
	unsigned int	m_dwLen;	// File Size
	unsigned int	m_dwPos;	// File Pointer
public:
	CEFile();
	~CEFile();
	bool			Open(char* FileName);
	bool			Create(char* FileName);
	bool			Append(char* FileName);
	void			Close();
	unsigned int	Read(char* lpBuffer, unsigned int dwReadBytes);
	unsigned int	Write(char* lpBuffer, unsigned int dwWriteBytes);
	unsigned int	Seek(long lDistance, unsigned int dwMoveMethod);
	unsigned int	Tell();
	unsigned int	Size();
};
//---------------------------------------------------------------------------
#endif
